#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_HardWareTest_Arm.h"
#include "SerialPortObject.h"

class HardWareTest_Arm : public QMainWindow
{
	Q_OBJECT

public:
	HardWareTest_Arm(QWidget *parent = Q_NULLPTR);
	~HardWareTest_Arm();
	void initData();
	void createAction();
	void diyUi();
	void startSerialPortThread(int deviceType);
	QPixmap createQRCode(QString pngName, const QString &text);
	void printQrcode(QString pngName);
	void addItemContent(int row, int column, QString content, QTableWidget*  ptableWidget, int color);

signals:
	void SignalSendDataqToSerialPort(int type, QByteArray dataReceived);

	private slots:
	void SlotButtonClicked();
	void slotReceiveDataFromSP(int type, QByteArray dataReceived);

private:
	Ui::HardWareTest_ArmClass ui;

	SerialPortObject* m_serialPort_485;
	QThread* m_qthread_485;

	QMap<int, QLabel*> m_testResultLabel_rv1106;
	QMap<int, int> m_testResult_rv1126;

	bool m_isSerialPortOpened;
};
